/*
  MinCC - Minimalist Compiler Collection
  Copyright (C) 2009 Scott Lawrence

  MinCC is free software: you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  MinCC is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
  License for more details.

  You should have received a copy of the GNU General Public License
  along with mincc.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef CMDLINE_HPP
#define CMDLINE_HPP

#ifdef HAVE_CURSES_H
#define D_CURSES 1
#else
#define D_CURSES 0
#endif

#ifdef HAVE_NCURSES_H
#define D_NCURSES 1
#else
#define D_NCURSES 0
#endif

//macro to handle options
#define START_OPTIONS() struct opt_t options[]={
#define OPTION(x,y,z) {x,y,z},
#define END_OPTIONS {"",-1,0}};

#define CMD_FUNC(x) int x(char **);

//the maximum number of arguments the program will accept
#define MAX_ARGS 1000

//the maximum number of files the program will compile
#define MAX_FILES 100

struct opt_t {
    const char *name;
    int args;
    int (*call)(char **);
};

extern struct opt_t options[];

void noargs();
void execArg(int,char **,int &);

//the functions that can be called by options
int printHelp(char **);
int printVersion(char **);
int setOutput(char **);
CMD_FUNC(printBuildInfo);

#endif
